//配置路由
import React, { Suspense } from "react";
let Home = React.lazy(() => import('../pages/home'))
let Sety = React.lazy(() => import('../components/Sety/Index'))
let Profile = React.lazy(() => import('../pages/profile'))
let MasterPlace = React.lazy(() => import('../pages/masterplate'))
let AITool = React.lazy(() => import('../pages/AITool'))
let Material = React.lazy(() => import('../pages/material'))
let AICreate = React.lazy(() => import('../pages/AICreate'))
let AIChat = React.lazy(() => import('../pages/AIChat'))
let Selected_templates = React.lazy(() => import('../pages/Selected_templates/Selected_templates'))
let Layout = React.lazy(() => import('../pages/layout'))
let LowCode= React.lazy(() => import('../com/LowCode/LowCode'))
let Createdesign=React.lazy(()=>import('../com/Createdesign/Createdesign'))
let Workbenches = React.lazy(() => import('../pages/workbenches/workbenches'))
let Mydesign=React.lazy(()=>import('../pages/Mydesign/Mydesign'))
export const secondRoutes = [
    //创作首页
    {
        path: '/',
        element: <Suspense fallback='加载中...'>
            <Home />
        </Suspense>
    },
    //我的
    {
        path: '/material',
        element: <Suspense fallback='加载中...'>
            <Material />
        </Suspense>
    },
    //模版
    {
        path: '/masterplate',
        element: <Suspense fallback='加载中...'>
            <MasterPlace />
        </Suspense>
    },
    //素材
    {
        path: '/profile',
        element: <Suspense fallback='加载中...'>
            <Profile />
        </Suspense>
    },
    //AI工具
    {
        path: '/AITool',
        element: <Suspense fallback='加载中...'>
            <AITool />
        </Suspense>
    },
    //AI创作
    {
        path: '/AICreate',
        element: <Suspense fallback='加载中...'>
            <AICreate />
        </Suspense>
    },
    //AI对话
    {
        path: '/AIChat',
        element: <Suspense fallback='加载中...'>
            <AIChat />
        </Suspense>
    },
    //精选模版
    {
        path: '/Selected_templates',
        element: <Suspense fallback='加载中...'>
            <Selected_templates />
        </Suspense>
    },
    //素材
    {
        path: '/Source_material',
        element: <Suspense fallback='加载中...'>
            <Mydesign />
        </Suspense>
    },

]

let routes = [
    //布局
    {
        path: '/',
        element: <Suspense fallback='加载中...'>
            <Layout />
        </Suspense>,
        children: secondRoutes
    },

    //客服自动回复
    {
        path: '/sety',
        element: <Suspense fallback='加载中...'>
            <Sety />
        </Suspense>
    },
    //图片处理
    {
        path: '/Createdesign',
        element: <Suspense fallback='加载中...'>
            <Createdesign />
        </Suspense>
    },

    //工作台
    {
        path: '/workbenches',
        element: <Suspense fallback='加载中...'>
            <Workbenches />
        </Suspense>
    },
    //低代码区
    {
        path: '/lowcode',
        element: <Suspense fallback='加载中...'>
            <LowCode />
        </Suspense>
    },

    //404页面
    {
        path: '*',
        element: <Suspense fallback='加载中...'>
            <h1>页面资源未找到</h1>
        </Suspense>
    },

]

export default routes